home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Just Call Me Internet
/
Just Call Me Internet.iso
/
prog
/
atari
/
m2
/
cat3src
/
magic
/
d
/
magicxbi.d
< prev
next >
Wrap
Text File
|
1997-10-26
|
11KB
|
319 lines
(*----------------------------------------------------------------------*
* *
* MAGIC Modula's All purpose GEM Interface Cadre *
* ÿ ÿ ÿ ÿ ÿ *
*----------------------------------------------------------------------*
* Version 3.30 02.02.1992 (C)90/91/92 by Peter Hellinger Software *
*----------------------------------------------------------------------*
* Dieses Modul ist urheberrechtlich geschtzt. *
* *
* Die Verffentlichung des Quelltextes oder Teilen daraus in schrift- *
* licher Form, insbesondere in Zeitschriften, sowie die Verbreitung *
* ber Public-Domain-Hndler bedarf der ausdrcklichen schriftlichen *
* Genehmigung des Autors! *
* *
* Der Autor gibt hiermit die ausdrckliche Erlaubnis, das Modul jeder- *
* zeit auch im Quelltext weiterzugegeben, sofern dessen Text und ins- *
* besondere dieser Urheberrechts-Vermerk nicht verndert wird, und *
* durch die Weitergabe kein finanzieller Nutzen entsteht. Der Autor *
* behlt sich das Recht vor, diese Erlaubnis jederzeit u. ohne Angaben *
* von Grnden zu widerrufen. *
*----------------------------------------------------------------------*)
(*----------------------------------------------------------------------*
* MagicXBIOS Extendend Basic Input Output System Modula-2 Interface *
*----------------------------------------------------------------------*)
DEFINITION MODULE MagicXBIOS;
FROM MagicSys IMPORT Nil, Null, Bit0, Bit1, Bit2, Bit3, Bit4, Bit5, Bit6,
Bit7, Bit8, Bit9, Bit10, Bit11, Bit12, Bit13, Bit14,
Bit15, LOC, Byte, ByteSet, sWORD, sINTEGER, sCARDINAL,
sBITSET, lINTEGER, lCARDINAL, lWORD, lBITSET;
IMPORT SYSTEM;
CONST DisableMouse = 0;
RelativeMouse = 1;
AbsoluteMouse = 2;
KeycodeMouse = 4;
TYPE PARAM = RECORD
topMode: Byte;
buttons: Byte;
xparam: Byte;
yparam: Byte;
EXTRA: RECORD
xmax: sCARDINAL;
ymax: sCARDINAL;
xinitial: sCARDINAL;
yInitial: sCARDINAL;
END;
END;
PROCEDURE Initmouse (type: sINTEGER; VAR param: ARRAY OF LOC; vec: PROC);
PROCEDURE Physbase (): SYSTEM.ADDRESS;
PROCEDURE Logbase (): SYSTEM.ADDRESS;
PROCEDURE Getrez (): sINTEGER;
PROCEDURE Setscreen (logLoc, physLoc: SYSTEM.ADDRESS; rez: sINTEGER);
TYPE Palette = ARRAY [0..15] OF sCARDINAL;
PROCEDURE Setpalette (VAR palette: ARRAY OF LOC);
PROCEDURE Setcolor (colourNum, colour: sCARDINAL): sCARDINAL;
PROCEDURE Floprd (buf: SYSTEM.ADDRESS; drv, sec, trck, side, count: sINTEGER): sINTEGER;
PROCEDURE Flopwr (buf: SYSTEM.ADDRESS; drv, sec, trck, side, count: sINTEGER): sINTEGER;
PROCEDURE Flopfmt (buf: SYSTEM.ADDRESS; drv, spt, trck, side, il, virg: sINTEGER): sINTEGER;
PROCEDURE Midiws (VAR string: ARRAY OF LOC; len: sCARDINAL);
PROCEDURE Mfpint (intNo: sCARDINAL; vector: PROC);
CONST RS232 = 0;
IKBD = 1;
MIDI = 2;
TYPE PtrIOREC = POINTER TO IOREC;
IOREC = RECORD
ibuf: SYSTEM.ADDRESS; (* pointer to buffer *)
ibufsize: sCARDINAL; (* buffer size *)
ibufhd: sCARDINAL; (* head index *)
ibuftl: sCARDINAL; (* tail index *)
ibuflow: sCARDINAL; (* low water mark *)
ibufhi: sCARDINAL; (* high water mark *)
END;
PROCEDURE Iorec (dev: sINTEGER): SYSTEM.ADDRESS;
CONST Sp19200 = 0;
Sp9600 = 1;
Sp4800 = 2;
Sp3600 = 3;
Sp2400 = 4;
Sp2000 = 5;
Sp1800 = 6;
Sp1200 = 7;
Sp600 = 8;
Sp300 = 9;
Sp200 = 10;
Sp150 = 11;
Sp134 = 12;
Sp110 = 13;
Sp75 = 14;
Sp50 = 15;
CONST XONXOFF = Bit0;
RTSCTS = Bit1;
PROCEDURE Rsconf (speed: sINTEGER; flavor: sBITSET; u, r, t, s: sINTEGER): sINTEGER;
TYPE Keycode = POINTER TO ARRAY [0..132] OF CHAR; (* JGS *)
TYPE PtrKEYTAB = POINTER TO KEYTAB;
KEYTAB = RECORD
unshift: Keycode;
shift: Keycode;
capslock: Keycode;
END;
PROCEDURE Keytbl (VAR unshift, shift, capslock: SYSTEM.ADDRESS): SYSTEM.ADDRESS;
PROCEDURE Random (): lCARDINAL;
CONST SameNumber = -1;
NewNumber = 01000000H;
CONST SameType = -1;
SS180 = 0;
DS360 = 1;
SS360 = 2;
DS720 = 3;
CONST NoExecute = 0;
Execute = 1;
PROCEDURE Protobt (buf: SYSTEM.ADDRESS; num: lINTEGER; typ, exec: sINTEGER);
PROCEDURE Flopver (buf: SYSTEM.ADDRESS; drv, sec, trck, side, count: sINTEGER): sINTEGER;
PROCEDURE Scrdmp;
CONST CURSHIDE = 0;
CURSSHOW = 1;
CURSBLINK = 2;
CURSNOBLINK = 3;
CURSSETRATE = 4;
CURSGETRATE = 5;
PROCEDURE Cursconf (function, operand: sINTEGER): sINTEGER;
PROCEDURE Settime (datetime: lCARDINAL);
PROCEDURE Gettime (): lCARDINAL;
PROCEDURE Bioskeys;
PROCEDURE Ikbdws (str: ARRAY OF LOC; len: sCARDINAL);
PROCEDURE Jdisint (intNo: sCARDINAL);
PROCEDURE Jenabint (intNo: sCARDINAL);
PROCEDURE Giaccess (regno: sCARDINAL; data: Byte): sCARDINAL;
PROCEDURE Offgibit (bitno: sCARDINAL);
PROCEDURE Ongibit (bitno: sCARDINAL);
CONST TimerA = 0;
TimerB = 1;
TimerC = 2;
TimerD = 3;
PROCEDURE Xbtimer (timer, control, data: sCARDINAL; vec: PROC);
PROCEDURE Dosound (REF data: ARRAY OF LOC);
CONST DaisyWheel = Bit0;
Monochrome = Bit1;
EpsonPrinter = Bit2;
Final = Bit3;
RS232Port = Bit4;
SingleSheet = Bit5;
PROCEDURE Setprt (config: sBITSET): sBITSET;
TYPE PtrKBVECS = POINTER TO KBVECS;
KBVECS = RECORD
midivec: SYSTEM.ADDRESS; (* MIDI input *)
vkbderr: SYSTEM.ADDRESS; (* keyboard error *)
vmidierr: SYSTEM.ADDRESS; (* MIDI error *)
statvec: SYSTEM.ADDRESS; (* ikdb status packet *)
mousevec: SYSTEM.ADDRESS; (* mouse packet *)
clockvec: SYSTEM.ADDRESS; (* clock packet *)
joyvec: SYSTEM.ADDRESS; (* joystick packet *)
midisys: SYSTEM.ADDRESS;
ikbdsys: SYSTEM.ADDRESS;
END;
PROCEDURE Kbdvbase(): SYSTEM.ADDRESS;
PROCEDURE Kbrate (initial, repeat: sINTEGER): sCARDINAL;
TYPE PtrPBDEF = POINTER TO PBDEF;
PBDEF = RECORD
pbScrptr: SYSTEM.ADDRESS;
pbOffset: sINTEGER;
pbWidth: sINTEGER;
pbHeight: sINTEGER;
pbLeft: sINTEGER;
pbRight: sINTEGER;
pbScrez: sINTEGER;
pbPrrez: sINTEGER;
pbColptr: SYSTEM.ADDRESS;
pbPrttype: lCARDINAL;
pbPrport: sINTEGER;
pbMask: sINTEGER;
END;
PROCEDURE Prtblk (block: ARRAY OF LOC);
PROCEDURE Vsync;
PROCEDURE Supexec (code: SYSTEM.ADDRESS);
PROCEDURE Puntaes;
PROCEDURE Blitmode (flag: sINTEGER): sBITSET;
PROCEDURE Floprate (devno: sCARDINAL; newrate: sINTEGER): sINTEGER;
(*====================================================================*)
(* Folgende Funktionen sind erst auf TT-Rechnern verfgbar! *)
(*====================================================================*)
PROCEDURE DMAread (sec: lINTEGER; cnt: sINTEGER; buf: SYSTEM.ADDRESS;
dev: sINTEGER): lINTEGER;
PROCEDURE DMAwrite (sec: lINTEGER; cnt: sINTEGER; buf: SYSTEM.ADDRESS;
dev: sINTEGER): lINTEGER;
TYPE MAPTAB = RECORD
bconstat : PROCEDURE() : sINTEGER;
bconin : PROCEDURE() : lINTEGER;
bcostat : PROCEDURE() : lINTEGER;
bconout : PROCEDURE();
rsconf : PROCEDURE() : lCARDINAL;
iorec : PtrIOREC;
END;
BCONMAP = POINTER TO
RECORD
maptab : POINTER TO ARRAY sCARDINAL OF MAPTAB;
maptabsize : sINTEGER;
END;
PROCEDURE Bconmap (dev: sINTEGER): SYSTEM.ADDRESS;
(* Wenn das Mapping der seriellen Schnittstelle umgehaengt wird, so wird als
* Rueckgabewert das alte Mapping geliefert. Mit Bconmap (-2) kriegt man
* einen Pointer auf folgende Struktur:
* struct bconmap {
* LONG *maptab; /* ptr to map table */
* WORD maptabsize; /* number of lines in table */
* };
* Jeder maptab-Eintrag besteht aus sechs Pointern auf die schnittstellen-
* spezifischen Routinen fuer Bconstat, Bconin, Bconout, Rsconf und Iorec.
*)
CONST NVMread = 0;
NVMwrite = 1;
NVMinit = 2; (* loescht NVM und initialisiert Checksumme *)
PROCEDURE NVMaccess (mode, start, cnt: sINTEGER; buf: SYSTEM.ADDRESS): sINTEGER;
CONST GRAY = 4096; (* 2^12 *)
SMEAR = 32768; (* 2^15 *)
STLOW = 0; (* 000-00000000 *)
STMED = 256; (* 001- *)
STHIGH = 512; (* 010- *)
TTLOW = 1792; (* 111- *)
TTMED = 1024; (* 100- *)
TTHIGH = 1536; (* 110- *)
PROCEDURE EsetShift (mode: sINTEGER);
PROCEDURE EgetShift (): sINTEGER;
PROCEDURE EsetBank (bank: sINTEGER): sINTEGER;
PROCEDURE EsetColor (num, col: sINTEGER): sINTEGER;
PROCEDURE EsetPalette (start, cnt: sINTEGER; pal: ARRAY OF LOC): sINTEGER;
PROCEDURE EgetPalette (start, cnt: sINTEGER; VAR pal: ARRAY OF LOC): sINTEGER;
PROCEDURE EsetGray (mode: sINTEGER): sINTEGER;
PROCEDURE EsetSmear(mode: sINTEGER): sINTEGER;
END MagicXBIOS.